package com.qilu.careprogram.utils;

import org.apache.commons.lang3.time.DateUtils;

import java.text.ParseException;
import java.util.Date;

public class DateUtil {
    public static Date parseDate(String dateString) {
        if (dateString == null || dateString.isEmpty()) {
            return null;
        }
        try {
            // 使用 DateUtils.parseDate 来解析日期字符串
            return DateUtils.parseDate(dateString, "yyyy-MM-dd");
        } catch (ParseException e) {
            // Log the exception or handle it as needed
            e.printStackTrace();
            return null;
        }
    }
}
